// pages/activity/nationalDay/components/TopTaskList/TopTaskList.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    rankList: Array,
    showCount: Number,
  },
  observers: {
    "rankList, showCount": function (rankList, showCount) {
      if (rankList.length > 0) {
        this.setData({
          firstPerson: rankList[0] || {}
        })
      }
      if (rankList.length > 1) {
        this.setData({
          secondPerson: rankList[1] || {}
        })
      }
      if (rankList.length > 2) {
        this.setData({
          thirdPerson: rankList[2] || {}
        })
      }
      this.setData({
        bottomRankList: rankList.slice(3, showCount)
      })
    },

  },
  /**
   * 组件的初始数据
   */
  data: {
    bottomRankList: [],
    firstPerson: {
      emcee_name: '',
      end_like: '',
      money: '',
    },
    secondPerson: {
      emcee_name: '',
      end_like: '',
      money: '',
    },
    thirdPerson: {
      emcee_name: '',
      end_like: '',
      money: '',
    },

  },
  lifetimes() {
    this.setData({
      bottomRankList: rankList.slice(3, showCount)
    })
  },
  /**
   * 组件的方法列表
   */
  methods: {
    more() {
      this.triggerEvent('more')
    }
  }
})